{
  "openapi": "3.0.1",
  "info": {
    "title": "Concurrence and Referral - Agency to ePlanning API",
    "description": "# Authentication    \n\n Please use the subscription key provided by the Department to access the APIs.\n",
    "contact": {},
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api-uat.apps1.nsw.gov.au/planning/onlineCNR/v1"
    }
  ],
  "paths": {
    "/AcceptReturn/{CaseID}": {
      "put": {
        "summary": "AcceptReturn",
        "description": "This operation transfers the agency's decision  to accept or return the application from agency's IT system to ePlanning's IT System.",
        "operationId": "AcceptReturn",
        "parameters": [
          {
            "name": "CaseID",
            "in": "path",
            "description": "A fully qualified Agency Concurrence and Referral case. E.g. A-xxx case",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "OrganisationID",
            "in": "header",
            "description": "The council LGA name or Agency Organisation name to indicate where the request has originated from.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "IdempotencyID",
            "in": "header",
            "description": "Unique Id for this request. Allows the API to respond in an idempotent way if it has already been called with these parameters and prevents duplicate processing. Typically, a UUID such as \"63a9ba30-7a4b-4fac-b343-d1f05cf089f1\"",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Information request object",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptReturn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Case Submitted by Applicant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request supplied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-codegen-request-body-name": "body"
      }
    },
    "/Assessment/{CaseID}": {
      "put": {
        "summary": "Assessment",
        "description": "This operation transfers the particulars of the agency's request from agency's IT System to ePlanning's IT system. In this operation agency requests for additional information from council when required. When additional information is not required, the case is progressed to the subsequent stage.",
        "operationId": "Assessment",
        "parameters": [
          {
            "name": "CaseID",
            "in": "path",
            "description": "A fully qualified Agency Concurrence and Referral case. E.g. A-xxx case",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "OrganisationID",
            "in": "header",
            "description": "The agency to indicate where the request is originated from.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "IdempotencyID",
            "in": "header",
            "description": "Unique Id for this request. Allows the API to respond in an idempotent way if it has already been called with these parameters and prevents duplicate processing. Typically, a UUID such as \"63a9ba30-7a4b-4fac-b343-d1f05cf089f1\"",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Information request object",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Assessment"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Case updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request supplied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-codegen-request-body-name": "body"
      }
    },
    "/Decision/{CaseID}": {
      "put": {
        "summary": "Decision",
        "description": "This operation transfers the particulars of the agency's decision from agency's IT system to ePlanning's IT System. These are the various decisions that the agency could make - approve(withconditions),approve, refuse, Advice, Decision not required ).",
        "operationId": "Decision",
        "parameters": [
          {
            "name": "CaseID",
            "in": "path",
            "description": "A fully qualified Agency Concurrence and Referral case. E.g. A-xxx case",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "OrganisationID",
            "in": "header",
            "description": "The council LGA name or Agency Organisation name to indicate where the request is originated from.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "IdempotencyID",
            "in": "header",
            "description": "Unique Id for this request. Allows the API to respond in an idempotent way if it has already been called with these parameters and prevents duplicate processing. Typically, a UUID such as \"63a9ba30-7a4b-4fac-b343-d1f05cf089f1\"",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Information request object",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Decision"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Case decision is completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request supplied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-codegen-request-body-name": "body"
      }
    }
  },
  "components": {
    "schemas": {
      "DocResponse": {
        "title": "DocResponse",
        "type": "object",
        "properties": {
          "documentName": {
            "type": "string",
            "description": "Document name which was uploaded as part of respective API opeartion",
            "example": "test.docx"
          },
          "documentType": {
            "type": "string",
            "description": "Type of Document under which repsective document was uploaded"
          },
          "eplanningDocId": {
            "type": "string",
            "description": "Document Id of the respective document which was uploaded"
          },
          "externalOrgDocURL": {
            "type": "string",
            "description": "URL of the document which was uploaded"
          }
        }
      },
      "Error": {
        "title": "Error",
        "required": [
          "errorCode",
          "statusCode"
        ],
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "format": "int32",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Internal Server error 19876"
          },
          "activityId": {
            "type": "string",
            "example": "00000011-0ab-xy00-0000-500000000000"
          },
          "errorCode": {
            "type": "string",
            "example": "DPE_TMS01"
          },
          "errorDetails": {
            "type": "string",
            "example": "Inner Exceptions, Stack Trace, etc"
          }
        }
      },
      "DownloadableDocument": {
        "title": "DownloadableDocument",
        "required": [
          "documentName",
          "documentType",
          "documentURL",
          "uploadedDateTime"
        ],
        "type": "object",
        "properties": {
          "documentName": {
            "maxLength": 150,
            "type": "string",
            "description": "document Name has to be appended with file extension",
            "example": "test.docx"
          },
          "documentType": {
            "maxLength": 100,
            "type": "string"
          },
          "uploadedDateTime": {
            "type": "string",
            "format": "date-time"
          },
          "documentURL": {
            "maxLength": 500,
            "type": "string",
            "description": "URL of the document to be downloaded"
          }
        }
      },
      "UpdatedByEmail": {
        "title": "UpdatedByEmail",
        "type": "string",
        "description": "user mail address who performing the action."
      },
      "Decision": {
        "required": [
          "agencyResponse",
          "updatedByEmail"
        ],
        "type": "object",
        "properties": {
          "agencyResponse": {
            "$ref": "#/components/schemas/DecisionOutcome"
          },
          "decisionComments": {
            "type": "string",
            "description": "It infers the comments from the agency if they have selected agency response as 'Refuse' OR  'Decision not required'. It is mandatory when agency response is 'Decision not required'"
          },
          "Documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DownloadableDocument"
            }
          },
          "updatedByEmail": {
            "$ref": "#/components/schemas/UpdatedByEmail"
          }
        }
      },
      "DecisionOutcome": {
        "title": "DecisionOutcome",
        "type": "string",
        "description": "It infers the outcome of the decision on the Agency case A-xxx given by agency. One of the below mentioned values must be selected for One of the below mentioned values must be selected for determinedAuthority 1. Approve (with conditions) 2. Approve 3. Refuse 4. Advice 5. Decision not required",
        "example": "Refer to description for values"
      },
      "AcceptReturn": {
        "required": [
          "isAgencyAssessmentReq",
          "updatedByEmail"
        ],
        "type": "object",
        "properties": {
          "isAgencyAssessmentReq": {
            "$ref": "#/components/schemas/AgencyAssessment"
          },
          "rejectReason": {
            "title": "Please provide reason",
            "type": "string",
            "description": "This infers that the agency need to provide the reason for which the assessment is not required. Mandatory when isAgencyAssessmentReq is- 'Reject' OR 'Reject All'",
            "maxLength": 2000
          },
          "agencyOfficer": {
            "title": "Assign case to",
            "maxLength": 32,
            "type": "string",
            "description": "applicable when isAgencyAssessmentReq is \"Accept\" or \"Accept all\""
          },
          "clauseDetails": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClauseDetails"
            }
          },
          "Documents": {
            "type": "array",
            "description": "Documents will be available if the isAgencyAssessmentReq is 'Reject' OR 'Reject All'",
            "items": {
              "$ref": "#/components/schemas/DownloadableDocument"
            }
          },
          "updatedByEmail": {
            "$ref": "#/components/schemas/UpdatedByEmail"
          }
        }
      },
      "Assessment": {
        "title": "Assessment",
        "type": "object",
        "properties": {
          "canContinueAssessment": {
            "type": "boolean",
            "description": "it infers whether information provided by Council is sufficient for the assessment process. This is applicable when the Council confirms that the Applicant is willing to provide the additional information requested."
          },
          "moreInfoReqd": {
            "type": "boolean",
            "description": "it infers if more information is required from the Council on behalf of the applicant, for the assessment process? This will be applicable when 'canContinueAssessment' is false."
          },
          "detailsOfRequest": {
            "maxLength": 256,
            "type": "string",
            "description": "It infers about the details of information request and is applicable if 'moreInfoReqd' is true"
          },
          "requestDate": {
            "type": "string",
            "description": "Date of request for additional information",
            "format": "date",
            "example": "2021-03-18"
          },
          "Documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DownloadableDocument"
            }
          },
          "updatedByEmail": {
            "$ref": "#/components/schemas/UpdatedByEmail"
          }
        }
      },
      "AgencyAssessment": {
        "type": "string",
        "description": "Is agency assessment required? \"Accept all \",\" Reject all\" and \"Accept/Reject individually\" are only applicable when agency has more than one clause. One of the below mentioned values must be selected for One of the below mentioned values must be selected for AgencyAssessment 1. Accept 2. Reject 3. Accept all 4. Reject all 5. Accept/Reject individually",
        "example": "Refer to description for values"
      },
      "IndividualAgencyAssessment": {
        "type": "string",
        "description": "Is agency assessment required? One of the below mentioned values must be selected for One of the below mentioned values must be selected for IndividualAgencyAssessment 1. Accept 2. Reject",
        "example": "Refer to description for values"
      },
      "ClauseDetails": {
        "type": "object",
        "properties": {
          "isAgencyAssessmentReq": {
            "$ref": "#/components/schemas/IndividualAgencyAssessment"
          },
          "rejectReason": {
            "type": "string",
            "description": "This infers that the agency need to provide the reason for which the assessment is not required. Mandatory when isAgencyAssessmentReq is- 'Reject'",
            "maxLength": 2000
          },
          "clauseName": {
            "type": "string",
            "description": "Clause name corresponding to agency case."
          }
        },
        "description": "Applicable when isAgencyAssessmentReq is 'Accept/Reject individually'. Where there are multiple isAgencyAssessmentReq it implies that a single Agency may have multiple clauses to be accepted or Rejected Individually."
      }
    }
  }
}